package cn.fntop.weixin.config;

import com.jfinal.weixin.sdk.api.ApiConfig;
import com.jfinal.wxaapp.WxaConfig;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;

import java.util.List;
@Configuration
@Order(2)
@RequiredArgsConstructor
public class DataBaseConfig implements WxConfigLoader {
    private final FnConfig config;
    @Override
    public List<ApiConfig> loadWx() {
        // 公众号
        System.out.println("数据库实现取公众号配置【自定义】");
        return config.getWxConfigs();
    }

    @Override
    public List<WxaConfig> loadWxa() {
        // 小程序
        System.out.println("数据库实现取小程序配置【自定义】");
        return config.getWxaConfigs();
    }
}
